// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 修改字典 PUT /sys/dict */
export async function sysDictTypeControllerEdit(
  body: API.SysDictType,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新建字典 POST /sys/dict */
export async function sysDictTypeControllerSave(
  body: API.SysDictType,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除字典 DELETE /sys/dict */
export async function sysDictTypeControllerDeleteBatch(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页获取某一字典的字典项 GET /sys/dict/${param0} */
export async function sysDictTypeControllerPageById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictTypeControllerPageByIdParams,
  options?: { [key: string]: any },
) {
  const { typeId: param0, ...queryParams } = params;
  return request<API.ApiResultPaginationSysDictItem>(`${apiPrefix}/sys/dict/${param0}`, {
    method: 'GET',
    params: {
      ...queryParams,
    },
    ...(options || {}),
  });
}

/** 删除某一字典 DELETE /sys/dict/${param0} */
export async function sysDictTypeControllerDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictTypeControllerDeleteParams,
  options?: { [key: string]: any },
) {
  const { typeId: param0, ...queryParams } = params;
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取某一字典的字典项 GET /sys/dict/${param0}/noLimit */
export async function sysDictTypeControllerGetById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictTypeControllerGetByIdParams,
  options?: { [key: string]: any },
) {
  const { typeCode: param0, ...queryParams } = params;
  return request<API.ApiResultListSysDictItem>(`${apiPrefix}/sys/dict/${param0}/noLimit`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导入字典 POST /sys/dict/batch */
export async function sysDictTypeControllerSaveBatch(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/batch`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出字典 GET /sys/dict/export */
export async function sysDictTypeControllerExport(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictTypeControllerExportParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/sys/dict/export`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 自动生成字典编码 GET /sys/dict/generate */
export async function sysDictTypeControllerGenerateTypeCode(options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/generate`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 分页获取字典信息 GET /sys/dict/list */
export async function sysDictTypeControllerPageList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictTypeControllerPageListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationSysDictType>(`${apiPrefix}/sys/dict/list`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
